import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Login from '../views/login.vue'
import Home from '../views/home/home.vue'
import Message from '../views/home/components/message.vue'
import Friend from '../views/home/components/friend.vue'
import AddFriend from '../views/addFriend.vue'

const routes: Readonly<RouteRecordRaw[]> = [
  { path: '/', name: 'login', component: Login },
  {
    path: '/home',
    name: 'home',
    component: Home,
    children: [
      {
        path: 'message',
        name: 'message',
        component: Message
      },
      {
        path: 'friend',
        name: 'friend',
        component: Friend
      }
    ]
  },
  { path: '/addFriend', name: 'addFriend', component: AddFriend }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: routes
})

export default router
